//
//  DetailView.m
//  tmp
//
//  Created by Ky on 11. 5. 5..
//  Copyright 2011 서울. All rights reserved.
//

#import "DetailView.h"
#import "tmpViewController.h"

@implementation DetailView
@synthesize btnShowmap;
@synthesize btnBack;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [btnBack release];
    [btnShowmap release];
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [self setBtnBack:nil];
    [self setBtnShowmap:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

- (IBAction)selectBtnBack
{
    [self dismissModalViewControllerAnimated:YES];
}

- (IBAction)showOnTheMap
{
    if(self.parentViewController.parentViewController.parentViewController)
    {        
        tmpViewController *mainView = self.parentViewController.parentViewController.parentViewController;
        mainView.locx = 100;
        mainView.locy = 100;
        [self.parentViewController.parentViewController.parentViewController dismissModalViewControllerAnimated:YES];
        [self.parentViewController.parentViewController dismissModalViewControllerAnimated:YES];
        [self.parentViewController dismissModalViewControllerAnimated:YES];
        [self dismissModalViewControllerAnimated:YES];
    }
    else
    {        
        tmpViewController *mainView = self.parentViewController.parentViewController;
        mainView.locx = 200;
        mainView.locy = 200;
        [self.parentViewController.parentViewController dismissModalViewControllerAnimated:YES];
        [self.parentViewController dismissModalViewControllerAnimated:YES];
        [self dismissModalViewControllerAnimated:YES];
    }
}
@end
